-
Notifications
You must be signed in to change notification settings - Fork 93
gpuid-multiple-ids.php
: Added option to use multiple fields for count
#1142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughAdded an elseif branch to GPUID_Multiple_IDs::get_count to accept a Changes
Sequence Diagram(s)sequenceDiagram
actor Caller
participant GPUID as GPUID_Multiple_IDs
participant Entry as EntryStore
Caller->>GPUID: get_count(entry, countArg)
alt countArg contains field_ids array
loop for each field_id
GPUID->>Entry: get value for field_id
Entry-->>GPUID: valueN
end
GPUID->>GPUID: cast to int, abs, sum values
GPUID-->>Caller: return totalSum
else other count formats
GPUID->>GPUID: existing branches (single field, static, etc.)
GPUID-->>Caller: return result
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
e4900ba
to
04c2030
Compare
…count This is to extend the raffle/lottery ticket example on here: https://gravitywiz.com/gravity-forms-build-raffle-or-lottery/ While the guide supports "packages" of pre-defined counts for choice selections, it does not allow user-defined counts for multiple ticket types. This PR allows you to specify multiple field IDs that will all be counted and totalled to the final count allowing you to sell multiple ticket types with as many as a user would like to purchase.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the submission!
Context
https://gravitywiz.com/gravity-forms-build-raffle-or-lottery/
Summary
This is to extend the raffle/lottery ticket example on here: https://gravitywiz.com/gravity-forms-build-raffle-or-lottery/
While the guide supports "packages" of pre-defined counts for choice selections, it does not allow user-defined counts for multiple ticket types.
This PR allows you to specify multiple field IDs that will all be counted and totalled to the final count allowing you to sell multiple ticket types with as many as a user would like to purchase.